import vue from '@vitejs/plugin-vue';
import path from 'path';
import { defineConfig } from 'vite';
import { viteMockServe } from 'vite-plugin-mock';


export default defineConfig({
    base:'./',
    server:{
        host: '0.0.0.0',
        proxy: {
            '/api': {
                target: 'http://192.168.3.141:6200/',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '')
            },  
        }
    },
    plugins: [
        vue(),
        viteMockServe({
            supportTs: true,
        }),
    ],
    css: {
        // css预处理器
        preprocessorOptions: {
          less: {
            charset: false,
            additionalData: '@import "@/assets/style/global.less";',
          },
        },
      },    
    resolve: {
        alias: {
            '@': path.resolve(__dirname, 'src'),
        },
    },
});
